<html lang="en">
	<head>
		<meta charset="UTF-8">
		<title>切换城市</title>
		<script src="js/jquery.min.js"></script>
		<script src="js/layui.all.js"></script>
		<link rel="stylesheet" href="js/css/layui.css">
		<link rel="stylesheet" href="css/public.css">
		<script src="js/common.js"></script>
		<style>
			html,
			body {
				background-color: #fff;
			}

			.header {
				text-align: center;
				font-size: 20px;
				color: #4d7bab;
				line-height: 60px;
			}

			/*ul{ padding: 20px 0; }*/
			ul li {
				float: left;
				margin-left: 20px;
				margin-bottom: 20px;
			}

			ul li a {
				display: block;
				width: 98px;
				height: 48px;
				border: #dcdcdc solid 2px;
				line-height: 48px;
				text-align: center;
			}

			ul li a:hover {
				border-color: #4d7bab;
			}
		</style>
	</head>
	<body>
		<div class="header">点击切换</div>
		<ul>
			<c:forEach var="item" items="content">
				<li> <a href="javascript:;" class="citys" data-id="1" style=border-color:#4d7bab;>全国</a> </li>
			</c:forEach>
		</ul>
		<script>
			$(function() {
				$('.citys').click(function() {
					var url = '/goods/set_city'
					var Data = {
						id: $(this).attr('data-id')
					}
					Common.ajax(url, Data, function(data) {
						if (data.success) {
							parent.location.reload()
						} else {
							layer.msg(data.msg);
						}
					}, function(err) {
						console.log(err)
					}, function() {}, true, 'POST')
				})
			})
		</script>
	</body>
</html>
